class Solution:
    def minNumberInRotateArray(self, rotateArray):
        if rotateArray == []:
        	return 0
       	if rotateArray[0] <  rotateArray[-1]:
       		return rotateArray[0]
       	length = len(rotateArray)
       	if length == 1:
       		return rotateArray[0]
       	mid = length/2
       	left = 1
       	right = length-1
       	while left < right-1:
       		if rotateArray[mid] <= rotateArray[right]:
       			right = mid
       		elif rotateArray[mid] >= rotateArray[left]:
       			left = mid
       		print(left,right)
       		mid = int((left+right)/2)
       	return rotateArray[right]